package com.sunday.common.mq.rabbit.study.spring.study.e1_Base;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.listener.api.RabbitListenerErrorHandler;
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class SimpleRabbitListenerErrorHandler implements RabbitListenerErrorHandler {
    @Override
    public Object handleError(Message amqpMessage, org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception) throws Exception {
        log.info("Message : {}", amqpMessage);
        log.info("org.springframework.messaging.Message : {}", message);
        log.info("ListenerExecutionFailedException : {}", exception);
        return null;
    }
}
